package com.example.petstoreservice.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import jakarta.persistence.Column;
import jakarta.persistence.JoinColumn;
import jakarta.persistence.OneToOne;
import lombok.Data;

import java.math.BigDecimal;
import java.util.Date;

@Data
public class Order {
    @Column(name="orderIdString")
    private String orderIdString;
    @Column(name="orderId")
    private Long orderId;
    @Column(name="userName")
    private String userName;
    @OneToOne
    @JoinColumn(name="productId")
    private Product product;
    @Column(name="productId")
    private Long productId;
    @Column(name="amount")
    private Long amount;
    @Column(name="total")
    private BigDecimal total;
    @Column(name="status")
    private String status;
    @JsonFormat(pattern = "yyyy-MM-dd hh:mm:ss", timezone = "GMT+8")
    @Column(name="createTime")
    private Date createTime;
    @JsonFormat(pattern = "yyyy-MM-dd hh:mm:ss", timezone = "GMT+8")
    @Column(name="updateTime")
    private Date updateTime;
    @Column(name="info")
    private String info;
    @Column(name="addressId")
    private Long addressId;
}
